package com.mkait.thief.controller;

import com.mkait.thief.service.GoodsPoolService;
import com.mkait.thief.util.ResponseWrapper;
import com.mkait.thief.util.WrapResponseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/goodpool")
@RestController
@Transactional(rollbackFor = Exception.class)
public class GoodPoolController {

    @Autowired
    private GoodsPoolService goodsPoolService;

    /**
     * 给商品池增加权重
     * @return
     */
    @GetMapping("/addQ")
    public ResponseEntity<ResponseWrapper<String>> addQ(@RequestParam("poolId") String poolId, @RequestParam("tradeNo") String tradeNo) {
        String result = goodsPoolService.addQ(poolId, tradeNo);
        return WrapResponseMapper.ok(result);
    }

}
